package com.cloudeggtech.springboot.mybatis;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.StringUtils;

@ConfigurationProperties(prefix=MyBatisAutoConfiguration.CONFIGURATION_PREFIX)
public class MyBatisProperties {
	private static final String DEFAULT_MAPPER_LOCATIONS_PATTERN = "classpath*:META-INF/mybatis/mapper/**/*Mapper.xml";
	
	private String mapperLocationsPattern;

	public String getMapperLocationsPattern() {
		if (StringUtils.hasText(mapperLocationsPattern))
			return mapperLocationsPattern;
		
		return DEFAULT_MAPPER_LOCATIONS_PATTERN;
	}

	public void setMapperLocationsPattern(String mapperLocationsPattern) {
		this.mapperLocationsPattern = mapperLocationsPattern;
	}
}
